<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE PatternGuards #-}</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- | See &lt;https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst&gt;</span><span>
</span><span id="line-4"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Backpack.ReadyComponent</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-5"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier">ReadyComponent</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-6"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstantiatedComponent"><span class="hs-identifier">InstantiatedComponent</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-7"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#IndefiniteComponent"><span class="hs-identifier">IndefiniteComponent</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-8"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#rc_depends"><span class="hs-identifier">rc_depends</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#rc_uid"><span class="hs-identifier">rc_uid</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#rc_pkgid"><span class="hs-identifier">rc_pkgid</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#dispReadyComponent"><span class="hs-identifier">dispReadyComponent</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#toReadyComponents"><span class="hs-identifier">toReadyComponents</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-13"></span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#%3C%3E"><span class="hs-operator">(&lt;&gt;)</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Backpack.html"><span class="hs-identifier">Distribution.Backpack</span></a></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Backpack.LinkedComponent.html"><span class="hs-identifier">Distribution.Backpack.LinkedComponent</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Backpack.ModuleShape.html"><span class="hs-identifier">Distribution.Backpack.ModuleShape</span></a></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.AnnotatedId.html"><span class="hs-identifier">Distribution.Types.AnnotatedId</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.ModuleRenaming.html"><span class="hs-identifier">Distribution.Types.ModuleRenaming</span></a></span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.Component.html"><span class="hs-identifier">Distribution.Types.Component</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentInclude.html"><span class="hs-identifier">Distribution.Types.ComponentInclude</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentId.html"><span class="hs-identifier">Distribution.Types.ComponentId</span></a></span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentName.html"><span class="hs-identifier">Distribution.Types.ComponentName</span></a></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.PackageId.html"><span class="hs-identifier">Distribution.Types.PackageId</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.PackageName.Magic.html"><span class="hs-identifier">Distribution.Types.PackageName.Magic</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html"><span class="hs-identifier">Distribution.Types.UnitId</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Graph.html"><span class="hs-identifier">Distribution.Compat.Graph</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Compat.Graph.html#IsNode"><span class="hs-identifier">IsNode</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.Module.html"><span class="hs-identifier">Distribution.Types.Module</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.MungedPackageId.html"><span class="hs-identifier">Distribution.Types.MungedPackageId</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.MungedPackageName.html"><span class="hs-identifier">Distribution.Types.MungedPackageName</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.Library.html"><span class="hs-identifier">Distribution.Types.Library</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Types.LibraryName.html"><span class="hs-identifier">Distribution.Types.LibraryName</span></a></span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.ModuleName.html"><span class="hs-identifier">Distribution.ModuleName</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Package.html"><span class="hs-identifier">Distribution.Package</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Simple.Utils.html"><span class="hs-identifier">Distribution.Simple.Utils</span></a></span><span>
</span><span id="line-41"></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../pretty/src/Text.PrettyPrint.html#"><span class="hs-identifier">Text.PrettyPrint</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.html#"><span class="hs-identifier">Data.Map</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Map</span></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../containers/src/Data.Set.html#"><span class="hs-identifier">Data.Set</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Set</span></span><span>
</span><span id="line-46"></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Version.html"><span class="hs-identifier">Distribution.Version</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Pretty.html"><span class="hs-identifier">Distribution.Pretty</span></a></span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="hs-comment">-- | A 'ReadyComponent' is one that we can actually generate build</span><span>
</span><span id="line-51"></span><span class="hs-comment">-- products for.  We have a ready component for the typecheck-only</span><span>
</span><span id="line-52"></span><span class="hs-comment">-- products of every indefinite package, as well as a ready component</span><span>
</span><span id="line-53"></span><span class="hs-comment">-- for every way these packages can be fully instantiated.</span><span>
</span><span id="line-54"></span><span class="hs-comment">--</span><span>
</span><span id="line-55"></span><span class="hs-keyword">data</span><span> </span><span id="ReadyComponent"><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-var">ReadyComponent</span></a></span></span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="ReadyComponent"><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-var">ReadyComponent</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-57"></span><span>        </span><span id="rc_ann_id"><span class="annot"><span class="annottext">ReadyComponent -&gt; AnnotatedId UnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_ann_id"><span class="hs-identifier hs-var hs-var">rc_ann_id</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.AnnotatedId.html#AnnotatedId"><span class="hs-identifier hs-type">AnnotatedId</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-58"></span><span>        </span><span class="hs-comment">-- | The 'OpenUnitId' for this package.  At the moment, this</span><span>
</span><span id="line-59"></span><span>        </span><span class="hs-comment">-- is used in only one case, which is to determine if an</span><span>
</span><span id="line-60"></span><span>        </span><span class="hs-comment">-- export is of a module from this library (indefinite</span><span>
</span><span id="line-61"></span><span>        </span><span class="hs-comment">-- libraries record these exports as 'OpenModule');</span><span>
</span><span id="line-62"></span><span>        </span><span class="hs-comment">-- 'rc_open_uid' can be conveniently used to test for</span><span>
</span><span id="line-63"></span><span>        </span><span class="hs-comment">-- equality, whereas 'UnitId' cannot always be used in this</span><span>
</span><span id="line-64"></span><span>        </span><span class="hs-comment">-- case.</span><span>
</span><span id="line-65"></span><span>        </span><span id="rc_open_uid"><span class="annot"><span class="annottext">ReadyComponent -&gt; OpenUnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_open_uid"><span class="hs-identifier hs-var hs-var">rc_open_uid</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Backpack.html#OpenUnitId"><span class="hs-identifier hs-type">OpenUnitId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>        </span><span class="hs-comment">-- | Corresponds to 'lc_cid'.  Invariant: if 'rc_open_uid'</span><span>
</span><span id="line-67"></span><span>        </span><span class="hs-comment">-- records a 'ComponentId', it coincides with this one.</span><span>
</span><span id="line-68"></span><span>        </span><span id="rc_cid"><span class="annot"><span class="annottext">ReadyComponent -&gt; ComponentId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_cid"><span class="hs-identifier hs-var hs-var">rc_cid</span></a></span></span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentId.html#ComponentId"><span class="hs-identifier hs-type">ComponentId</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-69"></span><span>        </span><span class="hs-comment">-- | Corresponds to 'lc_component'.</span><span>
</span><span id="line-70"></span><span>        </span><span id="rc_component"><span class="annot"><span class="annottext">ReadyComponent -&gt; Component
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_component"><span class="hs-identifier hs-var hs-var">rc_component</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.Component.html#Component"><span class="hs-identifier hs-type">Component</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-71"></span><span>        </span><span class="hs-comment">-- | Corresponds to 'lc_exe_deps'.</span><span>
</span><span id="line-72"></span><span>        </span><span class="hs-comment">-- Build-tools don't participate in mix-in linking.</span><span>
</span><span id="line-73"></span><span>        </span><span class="hs-comment">-- (but what if they could?)</span><span>
</span><span id="line-74"></span><span>        </span><span id="rc_exe_deps"><span class="annot"><span class="annottext">ReadyComponent -&gt; [AnnotatedId UnitId]
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_exe_deps"><span class="hs-identifier hs-var hs-var">rc_exe_deps</span></a></span></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.AnnotatedId.html#AnnotatedId"><span class="hs-identifier hs-type">AnnotatedId</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-75"></span><span>        </span><span class="hs-comment">-- | Corresponds to 'lc_public'.</span><span>
</span><span id="line-76"></span><span>        </span><span id="rc_public"><span class="annot"><span class="annottext">ReadyComponent -&gt; Bool
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_public"><span class="hs-identifier hs-var hs-var">rc_public</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span class="hs-special">,</span><span>
</span><span id="line-77"></span><span>        </span><span class="hs-comment">-- | Extra metadata depending on whether or not this is an</span><span>
</span><span id="line-78"></span><span>        </span><span class="hs-comment">-- indefinite library (typechecked only) or an instantiated</span><span>
</span><span id="line-79"></span><span>        </span><span class="hs-comment">-- component (can be compiled).</span><span>
</span><span id="line-80"></span><span>        </span><span id="rc_i"><span class="annot"><span class="annottext">ReadyComponent -&gt; Either IndefiniteComponent InstantiatedComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_i"><span class="hs-identifier hs-var hs-var">rc_i</span></a></span></span><span>            </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#IndefiniteComponent"><span class="hs-identifier hs-type">IndefiniteComponent</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstantiatedComponent"><span class="hs-identifier hs-type">InstantiatedComponent</span></a></span><span>
</span><span id="line-81"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-comment">-- | The final, string 'UnitId' that will uniquely identify</span><span>
</span><span id="line-84"></span><span class="hs-comment">-- the compilation products of this component.</span><span>
</span><span id="line-85"></span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#rc_uid"><span class="hs-identifier hs-type">rc_uid</span></a></span><span>          </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span>
</span><span id="line-86"></span><span id="rc_uid"><span class="annot"><span class="annottext">rc_uid :: ReadyComponent -&gt; UnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_uid"><span class="hs-identifier hs-var hs-var">rc_uid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotatedId UnitId -&gt; UnitId
forall id. AnnotatedId id -&gt; id
</span><a href="Distribution.Types.AnnotatedId.html#ann_id"><span class="hs-identifier hs-var hs-var">ann_id</span></a></span><span> </span><span class="annot"><span class="annottext">(AnnotatedId UnitId -&gt; UnitId)
-&gt; (ReadyComponent -&gt; AnnotatedId UnitId)
-&gt; ReadyComponent
-&gt; UnitId
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; AnnotatedId UnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_ann_id"><span class="hs-identifier hs-var hs-var">rc_ann_id</span></a></span><span>
</span><span id="line-87"></span><span>
</span><span id="line-88"></span><span class="hs-comment">-- | Corresponds to 'lc_pkgid'.</span><span>
</span><span id="line-89"></span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#rc_pkgid"><span class="hs-identifier hs-type">rc_pkgid</span></a></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.PackageId.html#PackageId"><span class="hs-identifier hs-type">PackageId</span></a></span><span>
</span><span id="line-90"></span><span id="rc_pkgid"><span class="annot"><span class="annottext">rc_pkgid :: ReadyComponent -&gt; PackageId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_pkgid"><span class="hs-identifier hs-var hs-var">rc_pkgid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">AnnotatedId UnitId -&gt; PackageId
forall id. AnnotatedId id -&gt; PackageId
</span><a href="Distribution.Types.AnnotatedId.html#ann_pid"><span class="hs-identifier hs-var hs-var">ann_pid</span></a></span><span> </span><span class="annot"><span class="annottext">(AnnotatedId UnitId -&gt; PackageId)
-&gt; (ReadyComponent -&gt; AnnotatedId UnitId)
-&gt; ReadyComponent
-&gt; PackageId
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; AnnotatedId UnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_ann_id"><span class="hs-identifier hs-var hs-var">rc_ann_id</span></a></span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span class="hs-comment">-- | An 'InstantiatedComponent' is a library which is fully instantiated</span><span>
</span><span id="line-93"></span><span class="hs-comment">-- (or, possibly, has no requirements at all.)</span><span>
</span><span id="line-94"></span><span class="hs-keyword">data</span><span> </span><span id="InstantiatedComponent"><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstantiatedComponent"><span class="hs-identifier hs-var">InstantiatedComponent</span></a></span></span><span>
</span><span id="line-95"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="InstantiatedComponent"><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstantiatedComponent"><span class="hs-identifier hs-var">InstantiatedComponent</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-96"></span><span>        </span><span class="hs-comment">-- | How this library was instantiated.</span><span>
</span><span id="line-97"></span><span>        </span><span id="instc_insts"><span class="annot"><span class="annottext">InstantiatedComponent -&gt; [(ModuleName, Module)]
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_insts"><span class="hs-identifier hs-var hs-var">instc_insts</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-98"></span><span>        </span><span class="hs-comment">-- | Dependencies induced by 'instc_insts'.  These are recorded</span><span>
</span><span id="line-99"></span><span>        </span><span class="hs-comment">-- here because there isn't a convenient way otherwise to get</span><span>
</span><span id="line-100"></span><span>        </span><span class="hs-comment">-- the 'PackageId' we need to fill 'componentPackageDeps' as needed.</span><span>
</span><span id="line-101"></span><span>        </span><span id="instc_insts_deps"><span class="annot"><span class="annottext">InstantiatedComponent -&gt; [(UnitId, MungedPackageId)]
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_insts_deps"><span class="hs-identifier hs-var hs-var">instc_insts_deps</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.MungedPackageId.html#MungedPackageId"><span class="hs-identifier hs-type">MungedPackageId</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-102"></span><span>        </span><span class="hs-comment">-- | The modules exported/reexported by this library.</span><span>
</span><span id="line-103"></span><span>        </span><span id="instc_provides"><span class="annot"><span class="annottext">InstantiatedComponent -&gt; Map ModuleName Module
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_provides"><span class="hs-identifier hs-var hs-var">instc_provides</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-104"></span><span>        </span><span class="hs-comment">-- | The dependencies which need to be passed to the compiler</span><span>
</span><span id="line-105"></span><span>        </span><span class="hs-comment">-- to bring modules into scope.  These always refer to installed</span><span>
</span><span id="line-106"></span><span>        </span><span class="hs-comment">-- fully instantiated libraries.</span><span>
</span><span id="line-107"></span><span>        </span><span id="instc_includes"><span class="annot"><span class="annottext">InstantiatedComponent
-&gt; [ComponentInclude DefUnitId ModuleRenaming]
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_includes"><span class="hs-identifier hs-var hs-var">instc_includes</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.ComponentInclude.html#ComponentInclude"><span class="hs-identifier hs-type">ComponentInclude</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#DefUnitId"><span class="hs-identifier hs-type">DefUnitId</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ModuleRenaming.html#ModuleRenaming"><span class="hs-identifier hs-type">ModuleRenaming</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-108"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span class="hs-comment">-- | An 'IndefiniteComponent' is a library with requirements</span><span>
</span><span id="line-111"></span><span class="hs-comment">-- which we will typecheck only.</span><span>
</span><span id="line-112"></span><span class="hs-keyword">data</span><span> </span><span id="IndefiniteComponent"><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#IndefiniteComponent"><span class="hs-identifier hs-var">IndefiniteComponent</span></a></span></span><span>
</span><span id="line-113"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="IndefiniteComponent"><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#IndefiniteComponent"><span class="hs-identifier hs-var">IndefiniteComponent</span></a></span></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-114"></span><span>        </span><span class="hs-comment">-- | The requirements of the library.</span><span>
</span><span id="line-115"></span><span>        </span><span id="indefc_requires"><span class="annot"><span class="annottext">IndefiniteComponent -&gt; [ModuleName]
</span><a href="Distribution.Backpack.ReadyComponent.html#indefc_requires"><span class="hs-identifier hs-var hs-var">indefc_requires</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-116"></span><span>        </span><span class="hs-comment">-- | The modules exported/reexported by this library.</span><span>
</span><span id="line-117"></span><span>        </span><span id="indefc_provides"><span class="annot"><span class="annottext">IndefiniteComponent -&gt; Map ModuleName OpenModule
</span><a href="Distribution.Backpack.ReadyComponent.html#indefc_provides"><span class="hs-identifier hs-var hs-var">indefc_provides</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.html#OpenModule"><span class="hs-identifier hs-type">OpenModule</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-118"></span><span>        </span><span class="hs-comment">-- | The dependencies which need to be passed to the compiler</span><span>
</span><span id="line-119"></span><span>        </span><span class="hs-comment">-- to bring modules into scope.  These are 'OpenUnitId' because</span><span>
</span><span id="line-120"></span><span>        </span><span class="hs-comment">-- these may refer to partially instantiated libraries.</span><span>
</span><span id="line-121"></span><span>        </span><span id="indefc_includes"><span class="annot"><span class="annottext">IndefiniteComponent -&gt; [ComponentInclude OpenUnitId ModuleRenaming]
</span><a href="Distribution.Backpack.ReadyComponent.html#indefc_includes"><span class="hs-identifier hs-var hs-var">indefc_includes</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Types.ComponentInclude.html#ComponentInclude"><span class="hs-identifier hs-type">ComponentInclude</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.html#OpenUnitId"><span class="hs-identifier hs-type">OpenUnitId</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.ModuleRenaming.html#ModuleRenaming"><span class="hs-identifier hs-type">ModuleRenaming</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-122"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="hs-comment">-- | Compute the dependencies of a 'ReadyComponent' that should</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- be recorded in the @depends@ field of 'InstalledPackageInfo'.</span><span>
</span><span id="line-126"></span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#rc_depends"><span class="hs-identifier hs-type">rc_depends</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Types.MungedPackageId.html#MungedPackageId"><span class="hs-identifier hs-type">MungedPackageId</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-127"></span><span id="rc_depends"><span class="annot"><span class="annottext">rc_depends :: ReadyComponent -&gt; [(UnitId, MungedPackageId)]
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_depends"><span class="hs-identifier hs-var hs-var">rc_depends</span></a></span></span><span> </span><span id="local-6989586621679724014"><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679724014"><span class="hs-identifier hs-var">rc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(UnitId, MungedPackageId)] -&gt; [(UnitId, MungedPackageId)]
forall a. Ord a =&gt; [a] -&gt; [a]
</span><a href="Distribution.Utils.Generic.html#ordNub"><span class="hs-identifier hs-var">ordNub</span></a></span><span> </span><span class="annot"><span class="annottext">([(UnitId, MungedPackageId)] -&gt; [(UnitId, MungedPackageId)])
-&gt; [(UnitId, MungedPackageId)] -&gt; [(UnitId, MungedPackageId)]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-128"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; Either IndefiniteComponent InstantiatedComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_i"><span class="hs-identifier hs-var hs-var">rc_i</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679724014"><span class="hs-identifier hs-var">rc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-129"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621679724012"><span class="annot"><span class="annottext">IndefiniteComponent
</span><a href="#local-6989586621679724012"><span class="hs-identifier hs-var">indefc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-130"></span><span>            </span><span class="annot"><span class="annottext">(ComponentInclude OpenUnitId ModuleRenaming
 -&gt; (UnitId, MungedPackageId))
-&gt; [ComponentInclude OpenUnitId ModuleRenaming]
-&gt; [(UnitId, MungedPackageId)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679724011"><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679724011"><span class="hs-identifier hs-var">ci</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OpenUnitId -&gt; UnitId
</span><a href="Distribution.Backpack.html#abstractUnitId"><span class="hs-identifier hs-var">abstractUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">(OpenUnitId -&gt; UnitId) -&gt; OpenUnitId -&gt; UnitId
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming -&gt; OpenUnitId
forall id rn. ComponentInclude id rn -&gt; id
</span><a href="Distribution.Types.ComponentInclude.html#ci_id"><span class="hs-identifier hs-var">ci_id</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679724011"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming -&gt; MungedPackageId
forall id rn.
Pretty id =&gt;
ComponentInclude id rn -&gt; MungedPackageId
</span><a href="#local-6989586621679724008"><span class="hs-identifier hs-var">toMungedPackageId</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679724011"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-131"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IndefiniteComponent -&gt; [ComponentInclude OpenUnitId ModuleRenaming]
</span><a href="Distribution.Backpack.ReadyComponent.html#indefc_includes"><span class="hs-identifier hs-var hs-var">indefc_includes</span></a></span><span> </span><span class="annot"><span class="annottext">IndefiniteComponent
</span><a href="#local-6989586621679724012"><span class="hs-identifier hs-var">indefc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-132"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679724007"><span class="annot"><span class="annottext">InstantiatedComponent
</span><a href="#local-6989586621679724007"><span class="hs-identifier hs-var">instc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-133"></span><span>            </span><span class="annot"><span class="annottext">(ComponentInclude DefUnitId ModuleRenaming
 -&gt; (UnitId, MungedPackageId))
-&gt; [ComponentInclude DefUnitId ModuleRenaming]
-&gt; [(UnitId, MungedPackageId)]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679724006"><span class="annot"><span class="annottext">ComponentInclude DefUnitId ModuleRenaming
</span><a href="#local-6989586621679724006"><span class="hs-identifier hs-var">ci</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DefUnitId -&gt; UnitId
</span><a href="Distribution.Types.UnitId.html#unDefUnitId"><span class="hs-identifier hs-var hs-var">unDefUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">(DefUnitId -&gt; UnitId) -&gt; DefUnitId -&gt; UnitId
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude DefUnitId ModuleRenaming -&gt; DefUnitId
forall id rn. ComponentInclude id rn -&gt; id
</span><a href="Distribution.Types.ComponentInclude.html#ci_id"><span class="hs-identifier hs-var">ci_id</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude DefUnitId ModuleRenaming
</span><a href="#local-6989586621679724006"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ComponentInclude DefUnitId ModuleRenaming -&gt; MungedPackageId
forall id rn.
Pretty id =&gt;
ComponentInclude id rn -&gt; MungedPackageId
</span><a href="#local-6989586621679724008"><span class="hs-identifier hs-var">toMungedPackageId</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude DefUnitId ModuleRenaming
</span><a href="#local-6989586621679724006"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstantiatedComponent
-&gt; [ComponentInclude DefUnitId ModuleRenaming]
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_includes"><span class="hs-identifier hs-var hs-var">instc_includes</span></a></span><span> </span><span class="annot"><span class="annottext">InstantiatedComponent
</span><a href="#local-6989586621679724007"><span class="hs-identifier hs-var">instc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-135"></span><span>              </span><span class="annot"><span class="annottext">[(UnitId, MungedPackageId)]
-&gt; [(UnitId, MungedPackageId)] -&gt; [(UnitId, MungedPackageId)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">InstantiatedComponent -&gt; [(UnitId, MungedPackageId)]
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_insts_deps"><span class="hs-identifier hs-var hs-var">instc_insts_deps</span></a></span><span> </span><span class="annot"><span class="annottext">InstantiatedComponent
</span><a href="#local-6989586621679724007"><span class="hs-identifier hs-var">instc</span></a></span><span>
</span><span id="line-136"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-137"></span><span>    </span><span id="local-6989586621679724247"><span id="local-6989586621679724248"><span class="annot"><a href="#local-6989586621679724008"><span class="hs-identifier hs-type">toMungedPackageId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Pretty.html#Pretty"><span class="hs-identifier hs-type">Pretty</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679724248"><span class="hs-identifier hs-type">id</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentInclude.html#ComponentInclude"><span class="hs-identifier hs-type">ComponentInclude</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679724248"><span class="hs-identifier hs-type">id</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679724247"><span class="hs-identifier hs-type">rn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.MungedPackageId.html#MungedPackageId"><span class="hs-identifier hs-type">MungedPackageId</span></a></span></span></span><span>
</span><span id="line-138"></span><span>    </span><span id="local-6989586621679724008"><span class="annot"><span class="annottext">toMungedPackageId :: forall id rn.
Pretty id =&gt;
ComponentInclude id rn -&gt; MungedPackageId
</span><a href="#local-6989586621679724008"><span class="hs-identifier hs-var hs-var">toMungedPackageId</span></a></span></span><span> </span><span id="local-6989586621679723998"><span class="annot"><span class="annottext">ComponentInclude id rn
</span><a href="#local-6989586621679723998"><span class="hs-identifier hs-var">ci</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-139"></span><span>        </span><span class="annot"><span class="annottext">PackageId -&gt; LibraryName -&gt; MungedPackageId
</span><a href="Distribution.Types.MungedPackageId.html#computeCompatPackageId"><span class="hs-identifier hs-var">computeCompatPackageId</span></a></span><span>
</span><span id="line-140"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ComponentInclude id rn -&gt; PackageId
forall id rn. ComponentInclude id rn -&gt; PackageId
</span><a href="Distribution.Types.ComponentInclude.html#ci_pkgid"><span class="hs-identifier hs-var">ci_pkgid</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude id rn
</span><a href="#local-6989586621679723998"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>            </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ComponentInclude id rn -&gt; ComponentName
forall id rn. ComponentInclude id rn -&gt; ComponentName
</span><a href="Distribution.Types.ComponentInclude.html#ci_cname"><span class="hs-identifier hs-var">ci_cname</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude id rn
</span><a href="#local-6989586621679723998"><span class="hs-identifier hs-var">ci</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-142"></span><span>                </span><span class="annot"><a href="Distribution.Types.ComponentName.html#CLibName"><span class="hs-identifier hs-type">CLibName</span></a></span><span> </span><span id="local-6989586621679723993"><span class="annot"><span class="annottext">LibraryName
</span><a href="#local-6989586621679723993"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="#local-6989586621679723993"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-143"></span><span>                </span><span class="annot"><span class="annottext">ComponentName
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; LibraryName
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">([Char] -&gt; LibraryName) -&gt; [Char] -&gt; LibraryName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentId -&gt; [Char]
forall a. Pretty a =&gt; a -&gt; [Char]
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadyComponent -&gt; ComponentId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_cid"><span class="hs-identifier hs-var hs-var">rc_cid</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679724014"><span class="hs-identifier hs-var">rc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-144"></span><span>                        </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot; depends on non-library &quot;</span></span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; [Char] -&gt; [Char]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">id -&gt; [Char]
forall a. Pretty a =&gt; a -&gt; [Char]
</span><a href="Distribution.Pretty.html#prettyShow"><span class="hs-identifier hs-var">prettyShow</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ComponentInclude id rn -&gt; id
forall id rn. ComponentInclude id rn -&gt; id
</span><a href="Distribution.Types.ComponentInclude.html#ci_id"><span class="hs-identifier hs-var">ci_id</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude id rn
</span><a href="#local-6989586621679723998"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="hs-comment">-- | Get the 'MungedPackageId' of a 'ReadyComponent' IF it is</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- a library.</span><span>
</span><span id="line-148"></span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#rc_munged_id"><span class="hs-identifier hs-type">rc_munged_id</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.MungedPackageId.html#MungedPackageId"><span class="hs-identifier hs-type">MungedPackageId</span></a></span><span>
</span><span id="line-149"></span><span id="rc_munged_id"><span class="annot"><span class="annottext">rc_munged_id :: ReadyComponent -&gt; MungedPackageId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_munged_id"><span class="hs-identifier hs-var hs-var">rc_munged_id</span></a></span></span><span> </span><span id="local-6989586621679723989"><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723989"><span class="hs-identifier hs-var">rc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-150"></span><span>    </span><span class="annot"><span class="annottext">PackageId -&gt; LibraryName -&gt; MungedPackageId
</span><a href="Distribution.Types.MungedPackageId.html#computeCompatPackageId"><span class="hs-identifier hs-var">computeCompatPackageId</span></a></span><span>
</span><span id="line-151"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadyComponent -&gt; PackageId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_pkgid"><span class="hs-identifier hs-var">rc_pkgid</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723989"><span class="hs-identifier hs-var">rc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>        </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; Component
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_component"><span class="hs-identifier hs-var hs-var">rc_component</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723989"><span class="hs-identifier hs-var">rc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-153"></span><span>            </span><span class="annot"><a href="Distribution.Types.Component.html#CLib"><span class="hs-identifier hs-type">CLib</span></a></span><span> </span><span id="local-6989586621679723987"><span class="annot"><span class="annottext">Library
</span><a href="#local-6989586621679723987"><span class="hs-identifier hs-var">lib</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Library -&gt; LibraryName
</span><a href="Distribution.Types.Library.html#libName"><span class="hs-identifier hs-var hs-var">libName</span></a></span><span> </span><span class="annot"><span class="annottext">Library
</span><a href="#local-6989586621679723987"><span class="hs-identifier hs-var">lib</span></a></span><span>
</span><span id="line-154"></span><span>            </span><span class="annot"><span class="annottext">Component
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; LibraryName
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;rc_munged_id: not library&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Distribution.Package.html#Package"><span class="hs-identifier hs-type">Package</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-157"></span><span>    </span><span id="local-6989586621679723982"><span class="annot"><span class="annottext">packageId :: ReadyComponent -&gt; PackageId
</span><a href="Distribution.Package.html#packageId"><span class="hs-identifier hs-var hs-var hs-var hs-var">packageId</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; PackageId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_pkgid"><span class="hs-identifier hs-var">rc_pkgid</span></a></span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Distribution.Package.html#HasUnitId"><span class="hs-identifier hs-type">HasUnitId</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-160"></span><span>    </span><span id="local-6989586621679723975"><span class="annot"><span class="annottext">installedUnitId :: ReadyComponent -&gt; UnitId
</span><a href="Distribution.Package.html#installedUnitId"><span class="hs-identifier hs-var hs-var hs-var hs-var">installedUnitId</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; UnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_uid"><span class="hs-identifier hs-var">rc_uid</span></a></span><span>
</span><span id="line-161"></span><span>
</span><span id="line-162"></span><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="Distribution.Compat.Graph.html#IsNode"><span class="hs-identifier hs-type">IsNode</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-163"></span><span>    </span><span class="hs-keyword">type</span><span> </span><span id="Key"><span class="annot"><a href="Distribution.Compat.Graph.html#Key"><span class="hs-identifier hs-var">Key</span></a></span></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span>
</span><span id="line-164"></span><span>    </span><span id="local-6989586621679723968"><span class="annot"><span class="annottext">nodeKey :: ReadyComponent -&gt; Key ReadyComponent
</span><a href="Distribution.Compat.Graph.html#nodeKey"><span class="hs-identifier hs-var hs-var hs-var hs-var">nodeKey</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; Key ReadyComponent
ReadyComponent -&gt; UnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_uid"><span class="hs-identifier hs-var">rc_uid</span></a></span><span>
</span><span id="line-165"></span><span>    </span><span id="local-6989586621679723965"><span class="annot"><span class="annottext">nodeNeighbors :: ReadyComponent -&gt; [Key ReadyComponent]
</span><a href="Distribution.Compat.Graph.html#nodeNeighbors"><span class="hs-identifier hs-var hs-var hs-var hs-var">nodeNeighbors</span></a></span></span><span> </span><span id="local-6989586621679723963"><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723963"><span class="hs-identifier hs-var">rc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-166"></span><span>      </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; Either IndefiniteComponent InstantiatedComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_i"><span class="hs-identifier hs-var hs-var">rc_i</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723963"><span class="hs-identifier hs-var">rc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-167"></span><span>        </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679723962"><span class="annot"><span class="annottext">InstantiatedComponent
</span><a href="#local-6989586621679723962"><span class="hs-identifier hs-var">inst</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">InstantiatedComponent -&gt; [(ModuleName, Module)]
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_insts"><span class="hs-identifier hs-var hs-var">instc_insts</span></a></span><span> </span><span class="annot"><span class="annottext">InstantiatedComponent
</span><a href="#local-6989586621679723962"><span class="hs-identifier hs-var">inst</span></a></span><span>
</span><span id="line-168"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-169"></span><span>                   </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-170"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">ComponentId -&gt; UnitId
</span><a href="Distribution.Types.UnitId.html#newSimpleUnitId"><span class="hs-identifier hs-var">newSimpleUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadyComponent -&gt; ComponentId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_cid"><span class="hs-identifier hs-var hs-var">rc_cid</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723963"><span class="hs-identifier hs-var">rc</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-171"></span><span>        </span><span class="annot"><span class="annottext">Either IndefiniteComponent InstantiatedComponent
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[UnitId] -&gt; [UnitId] -&gt; [UnitId]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-172"></span><span>      </span><span class="annot"><span class="annottext">[UnitId] -&gt; [UnitId]
forall a. Ord a =&gt; [a] -&gt; [a]
</span><a href="Distribution.Utils.Generic.html#ordNub"><span class="hs-identifier hs-var">ordNub</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((UnitId, MungedPackageId) -&gt; UnitId)
-&gt; [(UnitId, MungedPackageId)] -&gt; [UnitId]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(UnitId, MungedPackageId) -&gt; UnitId
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadyComponent -&gt; [(UnitId, MungedPackageId)]
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_depends"><span class="hs-identifier hs-var">rc_depends</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723963"><span class="hs-identifier hs-var">rc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[UnitId] -&gt; [UnitId] -&gt; [UnitId]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-173"></span><span>      </span><span class="annot"><span class="annottext">(AnnotatedId UnitId -&gt; UnitId) -&gt; [AnnotatedId UnitId] -&gt; [UnitId]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotatedId UnitId -&gt; UnitId
forall id. AnnotatedId id -&gt; id
</span><a href="Distribution.Types.AnnotatedId.html#ann_id"><span class="hs-identifier hs-var hs-var">ann_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadyComponent -&gt; [AnnotatedId UnitId]
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_exe_deps"><span class="hs-identifier hs-var hs-var">rc_exe_deps</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723963"><span class="hs-identifier hs-var">rc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-174"></span><span>
</span><span id="line-175"></span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#dispReadyComponent"><span class="hs-identifier hs-type">dispReadyComponent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#Doc"><span class="hs-identifier hs-type">Doc</span></a></span><span>
</span><span id="line-176"></span><span id="dispReadyComponent"><span class="annot"><span class="annottext">dispReadyComponent :: ReadyComponent -&gt; Doc
</span><a href="Distribution.Backpack.ReadyComponent.html#dispReadyComponent"><span class="hs-identifier hs-var hs-var">dispReadyComponent</span></a></span></span><span> </span><span id="local-6989586621679723960"><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723960"><span class="hs-identifier hs-var">rc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-177"></span><span>    </span><span class="annot"><span class="annottext">Doc -&gt; Int -&gt; Doc -&gt; Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Char] -&gt; Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; Either IndefiniteComponent InstantiatedComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_i"><span class="hs-identifier hs-var hs-var">rc_i</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723960"><span class="hs-identifier hs-var">rc</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-178"></span><span>                    </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span class="annot"><span class="annottext">IndefiniteComponent
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;indefinite&quot;</span></span><span>
</span><span id="line-179"></span><span>                    </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="annot"><span class="annottext">InstantiatedComponent
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;definite&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-180"></span><span>            </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; Doc
forall a. Pretty a =&gt; a -&gt; Doc
</span><a href="Distribution.Pretty.html#pretty"><span class="hs-identifier hs-var">pretty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ReadyComponent -&gt; Key ReadyComponent
forall a. IsNode a =&gt; a -&gt; Key a
</span><a href="Distribution.Compat.Graph.html#nodeKey"><span class="hs-identifier hs-var">nodeKey</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723960"><span class="hs-identifier hs-var">rc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-181"></span><span>            </span><span class="hs-comment">{- &lt;+&gt; dispModSubst (Map.fromList (lc_insts lc)) -}</span><span> </span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">(Doc -&gt; Doc) -&gt; Doc -&gt; Doc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-182"></span><span>        </span><span class="annot"><span class="annottext">[Doc] -&gt; Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;depends&quot;</span></span><span> </span><span class="annot"><span class="annottext">Doc -&gt; Doc -&gt; Doc
</span><a href="../../pretty/src/Text.PrettyPrint.HughesPJ.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; Doc
forall a. Pretty a =&gt; a -&gt; Doc
</span><a href="Distribution.Pretty.html#pretty"><span class="hs-identifier hs-var">pretty</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723954"><span class="hs-identifier hs-var">uid</span></a></span><span>
</span><span id="line-183"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679723954"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723954"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; [Key ReadyComponent]
forall a. IsNode a =&gt; a -&gt; [Key a]
</span><a href="Distribution.Compat.Graph.html#nodeNeighbors"><span class="hs-identifier hs-var">nodeNeighbors</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent
</span><a href="#local-6989586621679723960"><span class="hs-identifier hs-var">rc</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="hs-comment">-- | The state of 'InstM'; a mapping from 'UnitId's to their</span><span>
</span><span id="line-186"></span><span class="hs-comment">-- ready component, or @Nothing@ if its an external</span><span>
</span><span id="line-187"></span><span class="hs-comment">-- component which we don't know how to build.</span><span>
</span><span id="line-188"></span><span class="hs-keyword">type</span><span> </span><span id="InstS"><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstS"><span class="hs-identifier hs-var">InstS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span class="hs-comment">-- | A state monad for doing instantiations (can't use actual</span><span>
</span><span id="line-191"></span><span class="hs-comment">-- State because that would be an extra dependency.)</span><span>
</span><span id="line-192"></span><span class="hs-keyword">newtype</span><span> </span><span id="InstM"><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-var">InstM</span></a></span></span><span> </span><span id="local-6989586621679724222"><span class="annot"><a href="#local-6989586621679724222"><span class="hs-identifier hs-type">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="InstM"><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-var">InstM</span></a></span></span><span> </span><span class="hs-special">{</span><span> </span><span id="runInstM"><span class="annot"><span class="annottext">forall a. InstM a -&gt; InstS -&gt; (a, InstS)
</span><a href="Distribution.Backpack.ReadyComponent.html#runInstM"><span class="hs-identifier hs-var hs-var">runInstM</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstS"><span class="hs-identifier hs-type">InstS</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679724222"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstS"><span class="hs-identifier hs-type">InstS</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-193"></span><span>
</span><span id="line-194"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679723949"><span class="annot"><a href="../../base/src/GHC.Base.html#Functor"><span class="hs-identifier hs-type">Functor</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-195"></span><span>    </span><span id="local-6989586621679723947"><span class="annot"><span class="annottext">fmap :: forall a b. (a -&gt; b) -&gt; InstM a -&gt; InstM b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var hs-var hs-var hs-var">fmap</span></a></span></span><span> </span><span id="local-6989586621679723946"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679723946"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span id="local-6989586621679723945"><span class="annot"><span class="annottext">InstS -&gt; (a, InstS)
</span><a href="#local-6989586621679723945"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(InstS -&gt; (b, InstS)) -&gt; InstM b
forall a. (InstS -&gt; (a, InstS)) -&gt; InstM a
</span><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-var">InstM</span></a></span><span> </span><span class="annot"><span class="annottext">((InstS -&gt; (b, InstS)) -&gt; InstM b)
-&gt; (InstS -&gt; (b, InstS)) -&gt; InstM b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723944"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723944"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679723943"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679723943"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679723942"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723942"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstS -&gt; (a, InstS)
</span><a href="#local-6989586621679723945"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723944"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-196"></span><span>                                     </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679723946"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679723943"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723942"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679723932"><span id="local-6989586621679723934"><span id="local-6989586621679723936"><span class="annot"><a href="../../base/src/GHC.Base.html#Applicative"><span class="hs-identifier hs-type">Applicative</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-199"></span><span>    </span><span id="local-6989586621679723930"><span class="annot"><span class="annottext">pure :: forall a. a -&gt; InstM a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var hs-var hs-var hs-var">pure</span></a></span></span><span> </span><span id="local-6989586621679723929"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679723929"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(InstS -&gt; (a, InstS)) -&gt; InstM a
forall a. (InstS -&gt; (a, InstS)) -&gt; InstM a
</span><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-var">InstM</span></a></span><span> </span><span class="annot"><span class="annottext">((InstS -&gt; (a, InstS)) -&gt; InstM a)
-&gt; (InstS -&gt; (a, InstS)) -&gt; InstM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723928"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723928"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679723929"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723928"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-200"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span id="local-6989586621679723927"><span class="annot"><span class="annottext">InstS -&gt; (a -&gt; b, InstS)
</span><a href="#local-6989586621679723927"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679723926"><span class="annot"><span class="annottext">&lt;*&gt; :: forall a b. InstM (a -&gt; b) -&gt; InstM a -&gt; InstM b
</span><a href="../../base/src/GHC.Base.html#%3C%2A%3E"><span class="hs-operator hs-var hs-var hs-var hs-var">&lt;*&gt;</span></a></span></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span id="local-6989586621679723925"><span class="annot"><span class="annottext">InstS -&gt; (a, InstS)
</span><a href="#local-6989586621679723925"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(InstS -&gt; (b, InstS)) -&gt; InstM b
forall a. (InstS -&gt; (a, InstS)) -&gt; InstM a
</span><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-var">InstM</span></a></span><span> </span><span class="annot"><span class="annottext">((InstS -&gt; (b, InstS)) -&gt; InstM b)
-&gt; (InstS -&gt; (b, InstS)) -&gt; InstM b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723924"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723924"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679723923"><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679723923"><span class="hs-identifier hs-var">f'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679723922"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723922"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstS -&gt; (a -&gt; b, InstS)
</span><a href="#local-6989586621679723927"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723924"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-201"></span><span>                                            </span><span class="hs-special">(</span><span id="local-6989586621679723921"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679723921"><span class="hs-identifier hs-var">x'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679723920"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723920"><span class="hs-identifier hs-var">s''</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstS -&gt; (a, InstS)
</span><a href="#local-6989586621679723925"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723922"><span class="hs-identifier hs-var">s'</span></a></span><span>
</span><span id="line-202"></span><span>                                        </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; b
</span><a href="#local-6989586621679723923"><span class="hs-identifier hs-var">f'</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679723921"><span class="hs-identifier hs-var">x'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723920"><span class="hs-identifier hs-var">s''</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-203"></span><span>
</span><span id="line-204"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679723915"><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-205"></span><span>    </span><span id="local-6989586621679723911"><span class="annot"><span class="annottext">return :: forall a. a -&gt; InstM a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var hs-var hs-var hs-var">return</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">a -&gt; InstM a
forall (f :: * -&gt; *) a. Applicative f =&gt; a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#pure"><span class="hs-identifier hs-var">pure</span></a></span><span>
</span><span id="line-206"></span><span>    </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span id="local-6989586621679723910"><span class="annot"><span class="annottext">InstS -&gt; (a, InstS)
</span><a href="#local-6989586621679723910"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679723909"><span class="annot"><span class="annottext">&gt;&gt;= :: forall a b. InstM a -&gt; (a -&gt; InstM b) -&gt; InstM b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var hs-var hs-var hs-var">&gt;&gt;=</span></a></span></span><span> </span><span id="local-6989586621679723908"><span class="annot"><span class="annottext">a -&gt; InstM b
</span><a href="#local-6989586621679723908"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(InstS -&gt; (b, InstS)) -&gt; InstM b
forall a. (InstS -&gt; (a, InstS)) -&gt; InstM a
</span><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-var">InstM</span></a></span><span> </span><span class="annot"><span class="annottext">((InstS -&gt; (b, InstS)) -&gt; InstM b)
-&gt; (InstS -&gt; (b, InstS)) -&gt; InstM b
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723907"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723907"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679723906"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679723906"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679723905"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723905"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstS -&gt; (a, InstS)
</span><a href="#local-6989586621679723910"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723907"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-207"></span><span>                                  </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">InstM b -&gt; InstS -&gt; (b, InstS)
forall a. InstM a -&gt; InstS -&gt; (a, InstS)
</span><a href="Distribution.Backpack.ReadyComponent.html#runInstM"><span class="hs-identifier hs-var hs-var">runInstM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; InstM b
</span><a href="#local-6989586621679723908"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679723906"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723905"><span class="hs-identifier hs-var">s'</span></a></span><span>
</span><span id="line-208"></span><span>
</span><span id="line-209"></span><span class="hs-comment">-- | Given a list of 'LinkedComponent's, expand the module graph</span><span>
</span><span id="line-210"></span><span class="hs-comment">-- so that we have an instantiated graph containing all of the</span><span>
</span><span id="line-211"></span><span class="hs-comment">-- instantiated components we need to build.</span><span>
</span><span id="line-212"></span><span class="hs-comment">--</span><span>
</span><span id="line-213"></span><span class="hs-comment">-- Instantiation intuitively follows the following algorithm:</span><span>
</span><span id="line-214"></span><span class="hs-comment">--</span><span>
</span><span id="line-215"></span><span class="hs-comment">--      instantiate a definite unit id p[S]:</span><span>
</span><span id="line-216"></span><span class="hs-comment">--          recursively instantiate each module M in S</span><span>
</span><span id="line-217"></span><span class="hs-comment">--          recursively instantiate modules exported by this unit</span><span>
</span><span id="line-218"></span><span class="hs-comment">--          recursively instantiate dependencies substituted by S</span><span>
</span><span id="line-219"></span><span class="hs-comment">--</span><span>
</span><span id="line-220"></span><span class="hs-comment">-- The implementation is a bit more involved to memoize instantiation</span><span>
</span><span id="line-221"></span><span class="hs-comment">-- if we have done it already.</span><span>
</span><span id="line-222"></span><span class="hs-comment">--</span><span>
</span><span id="line-223"></span><span class="hs-comment">-- We also call 'improveUnitId' during this process, so that fully</span><span>
</span><span id="line-224"></span><span class="hs-comment">-- instantiated components are given 'HashedUnitId'.</span><span>
</span><span id="line-225"></span><span class="hs-comment">--</span><span>
</span><span id="line-226"></span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#toReadyComponents"><span class="hs-identifier hs-type">toReadyComponents</span></a></span><span>
</span><span id="line-227"></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.MungedPackageId.html#MungedPackageId"><span class="hs-identifier hs-type">MungedPackageId</span></a></span><span>
</span><span id="line-228"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-comment">-- subst for the public component</span><span>
</span><span id="line-229"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Backpack.LinkedComponent.html#LinkedComponent"><span class="hs-identifier hs-type">LinkedComponent</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-230"></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-231"></span><span id="toReadyComponents"><span class="annot"><span class="annottext">toReadyComponents :: Map UnitId MungedPackageId
-&gt; Map ModuleName Module -&gt; [LinkedComponent] -&gt; [ReadyComponent]
</span><a href="Distribution.Backpack.ReadyComponent.html#toReadyComponents"><span class="hs-identifier hs-var hs-var">toReadyComponents</span></a></span></span><span> </span><span id="local-6989586621679723904"><span class="annot"><span class="annottext">Map UnitId MungedPackageId
</span><a href="#local-6989586621679723904"><span class="hs-identifier hs-var">pid_map</span></a></span></span><span> </span><span id="local-6989586621679723903"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723903"><span class="hs-identifier hs-var">subst0</span></a></span></span><span> </span><span id="local-6989586621679723902"><span class="annot"><span class="annottext">[LinkedComponent]
</span><a href="#local-6989586621679723902"><span class="hs-identifier hs-var">comps</span></a></span></span><span>
</span><span id="line-232"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Maybe ReadyComponent] -&gt; [ReadyComponent]
forall a. [Maybe a] -&gt; [a]
</span><a href="../../base/src/Data.Maybe.html#catMaybes"><span class="hs-identifier hs-var">catMaybes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstS -&gt; [Maybe ReadyComponent]
forall k a. Map k a -&gt; [a]
</span><a href="../../containers/src/Data.Map.Internal.html#elems"><span class="hs-identifier hs-var">Map.elems</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723899"><span class="hs-identifier hs-var">ready_map</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-233"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-234"></span><span>    </span><span id="local-6989586621679723898"><span class="annot"><span class="annottext">cmap :: Map ComponentId LinkedComponent
</span><a href="#local-6989586621679723898"><span class="hs-identifier hs-var hs-var">cmap</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(ComponentId, LinkedComponent)] -&gt; Map ComponentId LinkedComponent
forall k a. Ord k =&gt; [(k, a)] -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#fromList"><span class="hs-identifier hs-var">Map.fromList</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; ComponentId
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_cid"><span class="hs-identifier hs-var">lc_cid</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723895"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723895"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621679723895"><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723895"><span class="hs-identifier hs-var">lc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LinkedComponent]
</span><a href="#local-6989586621679723902"><span class="hs-identifier hs-var">comps</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-235"></span><span>
</span><span id="line-236"></span><span>    </span><span class="annot"><a href="#local-6989586621679723894"><span class="hs-identifier hs-type">instantiateUnitId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentId.html#ComponentId"><span class="hs-identifier hs-type">ComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-237"></span><span>                      </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#DefUnitId"><span class="hs-identifier hs-type">DefUnitId</span></a></span><span>
</span><span id="line-238"></span><span>    </span><span id="local-6989586621679723894"><span class="annot"><span class="annottext">instantiateUnitId :: ComponentId -&gt; Map ModuleName Module -&gt; InstM DefUnitId
</span><a href="#local-6989586621679723894"><span class="hs-identifier hs-var hs-var">instantiateUnitId</span></a></span></span><span> </span><span id="local-6989586621679723893"><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723893"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span id="local-6989586621679723892"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723892"><span class="hs-identifier hs-var">insts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(InstS -&gt; (DefUnitId, InstS)) -&gt; InstM DefUnitId
forall a. (InstS -&gt; (a, InstS)) -&gt; InstM a
</span><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-var">InstM</span></a></span><span> </span><span class="annot"><span class="annottext">((InstS -&gt; (DefUnitId, InstS)) -&gt; InstM DefUnitId)
-&gt; (InstS -&gt; (DefUnitId, InstS)) -&gt; InstM DefUnitId
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723891"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723891"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-239"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; InstS -&gt; Maybe (Maybe ReadyComponent)
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723889"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723891"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-240"></span><span>            </span><span class="annot"><span class="annottext">Maybe (Maybe ReadyComponent)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-241"></span><span>                </span><span class="hs-comment">-- Knot tied</span><span>
</span><span id="line-242"></span><span>                </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679723888"><span class="annot"><span class="annottext">Maybe ReadyComponent
</span><a href="#local-6989586621679723888"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679723887"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723887"><span class="hs-identifier hs-var">s'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstM (Maybe ReadyComponent)
-&gt; InstS -&gt; (Maybe ReadyComponent, InstS)
forall a. InstM a -&gt; InstS -&gt; (a, InstS)
</span><a href="Distribution.Backpack.ReadyComponent.html#runInstM"><span class="hs-identifier hs-var hs-var">runInstM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId
-&gt; ComponentId
-&gt; Map ModuleName Module
-&gt; InstM (Maybe ReadyComponent)
</span><a href="#local-6989586621679723886"><span class="hs-identifier hs-var">instantiateComponent</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723889"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723893"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723892"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; Maybe ReadyComponent -&gt; InstS -&gt; InstS
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723889"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ReadyComponent
</span><a href="#local-6989586621679723888"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723891"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-244"></span><span>                </span><span class="hs-keyword">in</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723884"><span class="hs-identifier hs-var">def_uid</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; Maybe ReadyComponent -&gt; InstS -&gt; InstS
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723889"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ReadyComponent
</span><a href="#local-6989586621679723888"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723887"><span class="hs-identifier hs-var">s'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-245"></span><span>            </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ReadyComponent
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723884"><span class="hs-identifier hs-var">def_uid</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723891"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-246"></span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-247"></span><span>        </span><span class="hs-comment">-- The mkDefUnitId here indicates that we assume</span><span>
</span><span id="line-248"></span><span>        </span><span class="hs-comment">-- that Cabal handles unit id hash allocation.</span><span>
</span><span id="line-249"></span><span>        </span><span class="hs-comment">-- Good thing about hashing here: map is only on string.</span><span>
</span><span id="line-250"></span><span>        </span><span class="hs-comment">-- Bad thing: have to repeatedly hash.</span><span>
</span><span id="line-251"></span><span>        </span><span id="local-6989586621679723884"><span class="annot"><span class="annottext">def_uid :: DefUnitId
</span><a href="#local-6989586621679723884"><span class="hs-identifier hs-var hs-var">def_uid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ComponentId -&gt; Map ModuleName Module -&gt; DefUnitId
</span><a href="Distribution.Backpack.html#mkDefUnitId"><span class="hs-identifier hs-var">mkDefUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723893"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723892"><span class="hs-identifier hs-var">insts</span></a></span><span>
</span><span id="line-252"></span><span>        </span><span id="local-6989586621679723889"><span class="annot"><span class="annottext">uid :: UnitId
</span><a href="#local-6989586621679723889"><span class="hs-identifier hs-var hs-var">uid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefUnitId -&gt; UnitId
</span><a href="Distribution.Types.UnitId.html#unDefUnitId"><span class="hs-identifier hs-var hs-var">unDefUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723884"><span class="hs-identifier hs-var">def_uid</span></a></span><span>
</span><span id="line-253"></span><span>
</span><span id="line-254"></span><span>    </span><span class="annot"><a href="#local-6989586621679723886"><span class="hs-identifier hs-type">instantiateComponent</span></a></span><span>
</span><span id="line-255"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentId.html#ComponentId"><span class="hs-identifier hs-type">ComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-256"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-257"></span><span>    </span><span id="local-6989586621679723886"><span class="annot"><span class="annottext">instantiateComponent :: UnitId
-&gt; ComponentId
-&gt; Map ModuleName Module
-&gt; InstM (Maybe ReadyComponent)
</span><a href="#local-6989586621679723886"><span class="hs-identifier hs-var hs-var">instantiateComponent</span></a></span></span><span> </span><span id="local-6989586621679723882"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723882"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span id="local-6989586621679723881"><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723881"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span id="local-6989586621679723880"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723880"><span class="hs-identifier hs-var">insts</span></a></span></span><span>
</span><span id="line-258"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679723879"><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723879"><span class="hs-identifier hs-var">lc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ComponentId
-&gt; Map ComponentId LinkedComponent -&gt; Maybe LinkedComponent
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723881"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">Map ComponentId LinkedComponent
</span><a href="#local-6989586621679723898"><span class="hs-identifier hs-var">cmap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-259"></span><span>            </span><span id="local-6989586621679723878"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723878"><span class="hs-identifier hs-var">provides</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(OpenModule -&gt; InstM Module)
-&gt; Map ModuleName OpenModule -&gt; InstM (Map ModuleName Module)
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map ModuleName Module -&gt; OpenModule -&gt; InstM Module
</span><a href="#local-6989586621679723876"><span class="hs-identifier hs-var">substModule</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723880"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModuleShape -&gt; Map ModuleName OpenModule
</span><a href="Distribution.Backpack.ModuleShape.html#modShapeProvides"><span class="hs-identifier hs-var hs-var">modShapeProvides</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; ModuleShape
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_shape"><span class="hs-identifier hs-var hs-var">lc_shape</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723879"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-260"></span><span>            </span><span class="hs-comment">-- NB: lc_sig_includes is omitted here, because we don't</span><span>
</span><span id="line-261"></span><span>            </span><span class="hs-comment">-- need them to build</span><span>
</span><span id="line-262"></span><span>            </span><span id="local-6989586621679723873"><span class="annot"><span class="annottext">[ComponentInclude DefUnitId ModuleRenaming]
</span><a href="#local-6989586621679723873"><span class="hs-identifier hs-var">includes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ComponentInclude OpenUnitId ModuleRenaming]
-&gt; (ComponentInclude OpenUnitId ModuleRenaming
    -&gt; InstM (ComponentInclude DefUnitId ModuleRenaming))
-&gt; InstM [ComponentInclude DefUnitId ModuleRenaming]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; [ComponentInclude OpenUnitId ModuleRenaming]
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_includes"><span class="hs-identifier hs-var hs-var">lc_includes</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723879"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((ComponentInclude OpenUnitId ModuleRenaming
  -&gt; InstM (ComponentInclude DefUnitId ModuleRenaming))
 -&gt; InstM [ComponentInclude DefUnitId ModuleRenaming])
-&gt; (ComponentInclude OpenUnitId ModuleRenaming
    -&gt; InstM (ComponentInclude DefUnitId ModuleRenaming))
-&gt; InstM [ComponentInclude DefUnitId ModuleRenaming]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723870"><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723870"><span class="hs-identifier hs-var">ci</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-263"></span><span>                </span><span id="local-6989586621679723869"><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723869"><span class="hs-identifier hs-var">uid'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module -&gt; OpenUnitId -&gt; InstM DefUnitId
</span><a href="#local-6989586621679723868"><span class="hs-identifier hs-var">substUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723880"><span class="hs-identifier hs-var">insts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming -&gt; OpenUnitId
forall id rn. ComponentInclude id rn -&gt; id
</span><a href="Distribution.Types.ComponentInclude.html#ci_id"><span class="hs-identifier hs-var">ci_id</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723870"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-264"></span><span>                </span><span class="annot"><span class="annottext">ComponentInclude DefUnitId ModuleRenaming
-&gt; InstM (ComponentInclude DefUnitId ModuleRenaming)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723870"><span class="hs-identifier hs-var">ci</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ci_ann_id :: AnnotatedId DefUnitId
</span><a href="Distribution.Types.ComponentInclude.html#ci_ann_id"><span class="hs-identifier hs-var">ci_ann_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(OpenUnitId -&gt; DefUnitId)
-&gt; AnnotatedId OpenUnitId -&gt; AnnotatedId DefUnitId
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DefUnitId -&gt; OpenUnitId -&gt; DefUnitId
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723869"><span class="hs-identifier hs-var">uid'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
-&gt; AnnotatedId OpenUnitId
forall id rn. ComponentInclude id rn -&gt; AnnotatedId id
</span><a href="Distribution.Types.ComponentInclude.html#ci_ann_id"><span class="hs-identifier hs-var hs-var">ci_ann_id</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723870"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-265"></span><span>            </span><span id="local-6989586621679723865"><span class="annot"><span class="annottext">[AnnotatedId UnitId]
</span><a href="#local-6989586621679723865"><span class="hs-identifier hs-var">exe_deps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(AnnotatedId OpenUnitId -&gt; InstM (AnnotatedId UnitId))
-&gt; [AnnotatedId OpenUnitId] -&gt; InstM [AnnotatedId UnitId]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map ModuleName Module
-&gt; AnnotatedId OpenUnitId -&gt; InstM (AnnotatedId UnitId)
</span><a href="#local-6989586621679723864"><span class="hs-identifier hs-var">substExeDep</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723880"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; [AnnotatedId OpenUnitId]
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_exe_deps"><span class="hs-identifier hs-var hs-var">lc_exe_deps</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723879"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-266"></span><span>            </span><span id="local-6989586621679723862"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723862"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(InstS -&gt; (InstS, InstS)) -&gt; InstM InstS
forall a. (InstS -&gt; (a, InstS)) -&gt; InstM a
</span><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-var">InstM</span></a></span><span> </span><span class="annot"><span class="annottext">((InstS -&gt; (InstS, InstS)) -&gt; InstM InstS)
-&gt; (InstS -&gt; (InstS, InstS)) -&gt; InstM InstS
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723861"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723861"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723861"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723861"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-267"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679723860"><span class="annot"><span class="annottext">getDep :: Module -&gt; [(UnitId, MungedPackageId)]
</span><a href="#local-6989586621679723860"><span class="hs-identifier hs-var hs-var">getDep</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span id="local-6989586621679723858"><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723858"><span class="hs-identifier hs-var">dep_def_uid</span></a></span></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span>
</span><span id="line-268"></span><span>                    </span><span class="hs-glyph">|</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679723857"><span class="annot"><span class="annottext">dep_uid :: UnitId
</span><a href="#local-6989586621679723857"><span class="hs-identifier hs-var hs-var">dep_uid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefUnitId -&gt; UnitId
</span><a href="Distribution.Types.UnitId.html#unDefUnitId"><span class="hs-identifier hs-var hs-var">unDefUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723858"><span class="hs-identifier hs-var">dep_def_uid</span></a></span><span>
</span><span id="line-269"></span><span>                    </span><span class="hs-comment">-- Lose DefUnitId invariant for rc_depends</span><span>
</span><span id="line-270"></span><span>                    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723857"><span class="hs-identifier hs-var">dep_uid</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-271"></span><span>                          </span><span class="annot"><span class="annottext">MungedPackageId -&gt; Maybe MungedPackageId -&gt; MungedPackageId
forall a. a -&gt; Maybe a -&gt; a
</span><a href="../../base/src/Data.Maybe.html#fromMaybe"><span class="hs-identifier hs-var">fromMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">MungedPackageId
</span><a href="#local-6989586621679723855"><span class="hs-identifier hs-var">err_pid</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe MungedPackageId -&gt; MungedPackageId)
-&gt; Maybe MungedPackageId -&gt; MungedPackageId
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-272"></span><span>                            </span><span class="annot"><span class="annottext">UnitId -&gt; Map UnitId MungedPackageId -&gt; Maybe MungedPackageId
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723857"><span class="hs-identifier hs-var">dep_uid</span></a></span><span> </span><span class="annot"><span class="annottext">Map UnitId MungedPackageId
</span><a href="#local-6989586621679723904"><span class="hs-identifier hs-var">pid_map</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe MungedPackageId
-&gt; Maybe MungedPackageId -&gt; Maybe MungedPackageId
forall (f :: * -&gt; *) a. Alternative f =&gt; f a -&gt; f a -&gt; f a
</span><a href="../../base/src/GHC.Base.html#%3C%7C%3E"><span class="hs-operator hs-var">&lt;|&gt;</span></a></span><span>
</span><span id="line-273"></span><span>                            </span><span class="annot"><span class="annottext">(ReadyComponent -&gt; MungedPackageId)
-&gt; Maybe ReadyComponent -&gt; Maybe MungedPackageId
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; MungedPackageId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_munged_id"><span class="hs-identifier hs-var">rc_munged_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe (Maybe ReadyComponent) -&gt; Maybe ReadyComponent
forall (m :: * -&gt; *) a. Monad m =&gt; m (m a) -&gt; m a
</span><a href="../../base/src/GHC.Base.html#join"><span class="hs-identifier hs-var">join</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; InstS -&gt; Maybe (Maybe ReadyComponent)
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723857"><span class="hs-identifier hs-var">dep_uid</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723862"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-274"></span><span>                  </span><span class="hs-keyword">where</span><span>
</span><span id="line-275"></span><span>                    </span><span id="local-6989586621679723855"><span class="annot"><span class="annottext">err_pid :: MungedPackageId
</span><a href="#local-6989586621679723855"><span class="hs-identifier hs-var hs-var">err_pid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MungedPackageName -&gt; Version -&gt; MungedPackageId
</span><a href="Distribution.Types.MungedPackageId.html#MungedPackageId"><span class="hs-identifier hs-var">MungedPackageId</span></a></span><span>
</span><span id="line-276"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageName -&gt; LibraryName -&gt; MungedPackageName
</span><a href="Distribution.Types.MungedPackageName.html#MungedPackageName"><span class="hs-identifier hs-var">MungedPackageName</span></a></span><span> </span><span class="annot"><span class="annottext">PackageName
</span><a href="Distribution.Types.PackageName.Magic.html#nonExistentPackageThisIsCabalBug"><span class="hs-identifier hs-var">nonExistentPackageThisIsCabalBug</span></a></span><span> </span><span class="annot"><span class="annottext">LibraryName
</span><a href="Distribution.Types.LibraryName.html#LMainLibName"><span class="hs-identifier hs-var">LMainLibName</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-277"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Int] -&gt; Version
</span><a href="Distribution.Types.Version.html#mkVersion"><span class="hs-identifier hs-var">mkVersion</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-278"></span><span>                </span><span id="local-6989586621679723848"><span class="annot"><span class="annottext">instc :: InstantiatedComponent
</span><a href="#local-6989586621679723848"><span class="hs-identifier hs-var hs-var">instc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstantiatedComponent :: [(ModuleName, Module)]
-&gt; [(UnitId, MungedPackageId)]
-&gt; Map ModuleName Module
-&gt; [ComponentInclude DefUnitId ModuleRenaming]
-&gt; InstantiatedComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#InstantiatedComponent"><span class="hs-identifier hs-type">InstantiatedComponent</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-279"></span><span>                            </span><span class="annot"><span class="annottext">instc_insts :: [(ModuleName, Module)]
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_insts"><span class="hs-identifier hs-var">instc_insts</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module -&gt; [(ModuleName, Module)]
forall k a. Map k a -&gt; [(k, a)]
</span><a href="../../containers/src/Data.Map.Internal.html#toList"><span class="hs-identifier hs-var">Map.toList</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723880"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-280"></span><span>                            </span><span class="annot"><span class="annottext">instc_insts_deps :: [(UnitId, MungedPackageId)]
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_insts_deps"><span class="hs-identifier hs-var">instc_insts_deps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Module -&gt; [(UnitId, MungedPackageId)])
-&gt; [Module] -&gt; [(UnitId, MungedPackageId)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; [(UnitId, MungedPackageId)]
</span><a href="#local-6989586621679723860"><span class="hs-identifier hs-var">getDep</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map ModuleName Module -&gt; [Module]
forall k a. Map k a -&gt; [a]
</span><a href="../../containers/src/Data.Map.Internal.html#elems"><span class="hs-identifier hs-var">Map.elems</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723880"><span class="hs-identifier hs-var">insts</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-281"></span><span>                            </span><span class="annot"><span class="annottext">instc_provides :: Map ModuleName Module
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_provides"><span class="hs-identifier hs-var">instc_provides</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723878"><span class="hs-identifier hs-var">provides</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-282"></span><span>                            </span><span class="annot"><span class="annottext">instc_includes :: [ComponentInclude DefUnitId ModuleRenaming]
</span><a href="Distribution.Backpack.ReadyComponent.html#instc_includes"><span class="hs-identifier hs-var">instc_includes</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ComponentInclude DefUnitId ModuleRenaming]
</span><a href="#local-6989586621679723873"><span class="hs-identifier hs-var">includes</span></a></span><span>
</span><span id="line-283"></span><span>                            </span><span class="hs-comment">-- NB: there is no dependency on the</span><span>
</span><span id="line-284"></span><span>                            </span><span class="hs-comment">-- indefinite version of this instantiated package here,</span><span>
</span><span id="line-285"></span><span>                            </span><span class="hs-comment">-- as (1) it doesn't go in depends in the</span><span>
</span><span id="line-286"></span><span>                            </span><span class="hs-comment">-- IPI: it's not a run time dep, and (2)</span><span>
</span><span id="line-287"></span><span>                            </span><span class="hs-comment">-- we don't have to tell GHC about it, it</span><span>
</span><span id="line-288"></span><span>                            </span><span class="hs-comment">-- will match up the ComponentId</span><span>
</span><span id="line-289"></span><span>                            </span><span class="hs-comment">-- automatically</span><span>
</span><span id="line-290"></span><span>                        </span><span class="hs-special">}</span><span>
</span><span id="line-291"></span><span>            </span><span class="annot"><span class="annottext">Maybe ReadyComponent -&gt; InstM (Maybe ReadyComponent)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe ReadyComponent -&gt; InstM (Maybe ReadyComponent))
-&gt; Maybe ReadyComponent -&gt; InstM (Maybe ReadyComponent)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; Maybe ReadyComponent
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent :: AnnotatedId UnitId
-&gt; OpenUnitId
-&gt; ComponentId
-&gt; Component
-&gt; [AnnotatedId UnitId]
-&gt; Bool
-&gt; Either IndefiniteComponent InstantiatedComponent
-&gt; ReadyComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-292"></span><span>                    </span><span class="annot"><span class="annottext">rc_ann_id :: AnnotatedId UnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_ann_id"><span class="hs-identifier hs-var">rc_ann_id</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; AnnotatedId ComponentId
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_ann_id"><span class="hs-identifier hs-var hs-var">lc_ann_id</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723879"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ann_id :: UnitId
</span><a href="Distribution.Types.AnnotatedId.html#ann_id"><span class="hs-identifier hs-var">ann_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723882"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span>
</span><span id="line-293"></span><span>                    </span><span class="annot"><span class="annottext">rc_open_uid :: OpenUnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_open_uid"><span class="hs-identifier hs-var">rc_open_uid</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefUnitId -&gt; OpenUnitId
</span><a href="Distribution.Backpack.html#DefiniteUnitId"><span class="hs-identifier hs-var">DefiniteUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId -&gt; DefUnitId
</span><a href="Distribution.Types.UnitId.html#unsafeMkDefUnitId"><span class="hs-identifier hs-var">unsafeMkDefUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723882"><span class="hs-identifier hs-var">uid</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-294"></span><span>                    </span><span class="annot"><span class="annottext">rc_cid :: ComponentId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_cid"><span class="hs-identifier hs-var">rc_cid</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LinkedComponent -&gt; ComponentId
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_cid"><span class="hs-identifier hs-var">lc_cid</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723879"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-295"></span><span>                    </span><span class="annot"><span class="annottext">rc_component :: Component
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_component"><span class="hs-identifier hs-var">rc_component</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LinkedComponent -&gt; Component
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_component"><span class="hs-identifier hs-var hs-var">lc_component</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723879"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-296"></span><span>                    </span><span class="annot"><span class="annottext">rc_exe_deps :: [AnnotatedId UnitId]
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_exe_deps"><span class="hs-identifier hs-var">rc_exe_deps</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[AnnotatedId UnitId]
</span><a href="#local-6989586621679723865"><span class="hs-identifier hs-var">exe_deps</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-297"></span><span>                    </span><span class="annot"><span class="annottext">rc_public :: Bool
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_public"><span class="hs-identifier hs-var">rc_public</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LinkedComponent -&gt; Bool
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_public"><span class="hs-identifier hs-var hs-var">lc_public</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723879"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-298"></span><span>                    </span><span class="annot"><span class="annottext">rc_i :: Either IndefiniteComponent InstantiatedComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_i"><span class="hs-identifier hs-var">rc_i</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InstantiatedComponent
-&gt; Either IndefiniteComponent InstantiatedComponent
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">InstantiatedComponent
</span><a href="#local-6989586621679723848"><span class="hs-identifier hs-var">instc</span></a></span><span>
</span><span id="line-299"></span><span>                   </span><span class="hs-special">}</span><span>
</span><span id="line-300"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ReadyComponent -&gt; InstM (Maybe ReadyComponent)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ReadyComponent
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span>    </span><span class="annot"><a href="#local-6989586621679723868"><span class="hs-identifier hs-type">substUnitId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.html#OpenUnitId"><span class="hs-identifier hs-type">OpenUnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#DefUnitId"><span class="hs-identifier hs-type">DefUnitId</span></a></span><span>
</span><span id="line-303"></span><span>    </span><span id="local-6989586621679723868"><span class="annot"><span class="annottext">substUnitId :: Map ModuleName Module -&gt; OpenUnitId -&gt; InstM DefUnitId
</span><a href="#local-6989586621679723868"><span class="hs-identifier hs-var hs-var">substUnitId</span></a></span></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Backpack.html#DefiniteUnitId"><span class="hs-identifier hs-type">DefiniteUnitId</span></a></span><span> </span><span id="local-6989586621679723840"><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723840"><span class="hs-identifier hs-var">uid</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-304"></span><span>        </span><span class="annot"><span class="annottext">DefUnitId -&gt; InstM DefUnitId
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723840"><span class="hs-identifier hs-var">uid</span></a></span><span>
</span><span id="line-305"></span><span>    </span><span class="annot"><a href="#local-6989586621679723868"><span class="hs-identifier hs-var">substUnitId</span></a></span><span> </span><span id="local-6989586621679723839"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723839"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Backpack.html#IndefFullUnitId"><span class="hs-identifier hs-type">IndefFullUnitId</span></a></span><span> </span><span id="local-6989586621679723837"><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723837"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span id="local-6989586621679723836"><span class="annot"><span class="annottext">Map ModuleName OpenModule
</span><a href="#local-6989586621679723836"><span class="hs-identifier hs-var">insts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-306"></span><span>        </span><span id="local-6989586621679723835"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723835"><span class="hs-identifier hs-var">insts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
-&gt; Map ModuleName OpenModule -&gt; InstM (Map ModuleName Module)
</span><a href="#local-6989586621679723834"><span class="hs-identifier hs-var">substSubst</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723839"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName OpenModule
</span><a href="#local-6989586621679723836"><span class="hs-identifier hs-var">insts</span></a></span><span>
</span><span id="line-307"></span><span>        </span><span class="annot"><span class="annottext">ComponentId -&gt; Map ModuleName Module -&gt; InstM DefUnitId
</span><a href="#local-6989586621679723894"><span class="hs-identifier hs-var">instantiateUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723837"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723835"><span class="hs-identifier hs-var">insts'</span></a></span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span>    </span><span class="hs-comment">-- NB: NOT composition</span><span>
</span><span id="line-310"></span><span>    </span><span class="annot"><a href="#local-6989586621679723834"><span class="hs-identifier hs-type">substSubst</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-311"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.html#OpenModule"><span class="hs-identifier hs-type">OpenModule</span></a></span><span>
</span><span id="line-312"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-313"></span><span>    </span><span id="local-6989586621679723834"><span class="annot"><span class="annottext">substSubst :: Map ModuleName Module
-&gt; Map ModuleName OpenModule -&gt; InstM (Map ModuleName Module)
</span><a href="#local-6989586621679723834"><span class="hs-identifier hs-var hs-var">substSubst</span></a></span></span><span> </span><span id="local-6989586621679723833"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723833"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span id="local-6989586621679723832"><span class="annot"><span class="annottext">Map ModuleName OpenModule
</span><a href="#local-6989586621679723832"><span class="hs-identifier hs-var">insts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(OpenModule -&gt; InstM Module)
-&gt; Map ModuleName OpenModule -&gt; InstM (Map ModuleName Module)
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map ModuleName Module -&gt; OpenModule -&gt; InstM Module
</span><a href="#local-6989586621679723876"><span class="hs-identifier hs-var">substModule</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723833"><span class="hs-identifier hs-var">subst</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map ModuleName OpenModule
</span><a href="#local-6989586621679723832"><span class="hs-identifier hs-var">insts</span></a></span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span>    </span><span class="annot"><a href="#local-6989586621679723876"><span class="hs-identifier hs-type">substModule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.html#OpenModule"><span class="hs-identifier hs-type">OpenModule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-316"></span><span>    </span><span id="local-6989586621679723876"><span class="annot"><span class="annottext">substModule :: Map ModuleName Module -&gt; OpenModule -&gt; InstM Module
</span><a href="#local-6989586621679723876"><span class="hs-identifier hs-var hs-var">substModule</span></a></span></span><span> </span><span id="local-6989586621679723831"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723831"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Backpack.html#OpenModuleVar"><span class="hs-identifier hs-type">OpenModuleVar</span></a></span><span> </span><span id="local-6989586621679723829"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621679723829"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-317"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679723828"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621679723828"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; Map ModuleName Module -&gt; Maybe Module
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621679723829"><span class="hs-identifier hs-var">mod_name</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723831"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module -&gt; InstM Module
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621679723828"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-318"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Char] -&gt; InstM Module
forall a. HasCallStack =&gt; [Char] -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">[Char]
</span><span class="hs-string">&quot;substModule: non-closing substitution&quot;</span></span><span>
</span><span id="line-319"></span><span>    </span><span class="annot"><a href="#local-6989586621679723876"><span class="hs-identifier hs-var">substModule</span></a></span><span> </span><span id="local-6989586621679723827"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723827"><span class="hs-identifier hs-var">subst</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Backpack.html#OpenModule"><span class="hs-identifier hs-type">OpenModule</span></a></span><span> </span><span id="local-6989586621679723825"><span class="annot"><span class="annottext">OpenUnitId
</span><a href="#local-6989586621679723825"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span id="local-6989586621679723824"><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621679723824"><span class="hs-identifier hs-var">mod_name</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-320"></span><span>        </span><span id="local-6989586621679723823"><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723823"><span class="hs-identifier hs-var">uid'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module -&gt; OpenUnitId -&gt; InstM DefUnitId
</span><a href="#local-6989586621679723868"><span class="hs-identifier hs-var">substUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723827"><span class="hs-identifier hs-var">subst</span></a></span><span> </span><span class="annot"><span class="annottext">OpenUnitId
</span><a href="#local-6989586621679723825"><span class="hs-identifier hs-var">uid</span></a></span><span>
</span><span id="line-321"></span><span>        </span><span class="annot"><span class="annottext">Module -&gt; InstM Module
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DefUnitId -&gt; ModuleName -&gt; Module
</span><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-var">Module</span></a></span><span> </span><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723823"><span class="hs-identifier hs-var">uid'</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName
</span><a href="#local-6989586621679723824"><span class="hs-identifier hs-var">mod_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-322"></span><span>
</span><span id="line-323"></span><span>    </span><span class="annot"><a href="#local-6989586621679723864"><span class="hs-identifier hs-type">substExeDep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../containers/src/Data.Map.Internal.html#Map"><span class="hs-identifier hs-type">Map</span></a></span><span> </span><span class="annot"><a href="Distribution.ModuleName.html#ModuleName"><span class="hs-identifier hs-type">ModuleName</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.Module.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span>
</span><span id="line-324"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.AnnotatedId.html#AnnotatedId"><span class="hs-identifier hs-type">AnnotatedId</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.html#OpenUnitId"><span class="hs-identifier hs-type">OpenUnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Types.AnnotatedId.html#AnnotatedId"><span class="hs-identifier hs-type">AnnotatedId</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-325"></span><span>    </span><span id="local-6989586621679723864"><span class="annot"><span class="annottext">substExeDep :: Map ModuleName Module
-&gt; AnnotatedId OpenUnitId -&gt; InstM (AnnotatedId UnitId)
</span><a href="#local-6989586621679723864"><span class="hs-identifier hs-var hs-var">substExeDep</span></a></span></span><span> </span><span id="local-6989586621679723822"><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723822"><span class="hs-identifier hs-var">insts</span></a></span></span><span> </span><span id="local-6989586621679723821"><span class="annot"><span class="annottext">AnnotatedId OpenUnitId
</span><a href="#local-6989586621679723821"><span class="hs-identifier hs-var">exe_aid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-326"></span><span>        </span><span id="local-6989586621679723820"><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723820"><span class="hs-identifier hs-var">exe_uid'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module -&gt; OpenUnitId -&gt; InstM DefUnitId
</span><a href="#local-6989586621679723868"><span class="hs-identifier hs-var">substUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723822"><span class="hs-identifier hs-var">insts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">AnnotatedId OpenUnitId -&gt; OpenUnitId
forall id. AnnotatedId id -&gt; id
</span><a href="Distribution.Types.AnnotatedId.html#ann_id"><span class="hs-identifier hs-var hs-var">ann_id</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotatedId OpenUnitId
</span><a href="#local-6989586621679723821"><span class="hs-identifier hs-var">exe_aid</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-327"></span><span>        </span><span class="annot"><span class="annottext">AnnotatedId UnitId -&gt; InstM (AnnotatedId UnitId)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">AnnotatedId OpenUnitId
</span><a href="#local-6989586621679723821"><span class="hs-identifier hs-var">exe_aid</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ann_id :: UnitId
</span><a href="Distribution.Types.AnnotatedId.html#ann_id"><span class="hs-identifier hs-var">ann_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefUnitId -&gt; UnitId
</span><a href="Distribution.Types.UnitId.html#unDefUnitId"><span class="hs-identifier hs-var hs-var">unDefUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723820"><span class="hs-identifier hs-var">exe_uid'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-328"></span><span>
</span><span id="line-329"></span><span>    </span><span class="annot"><a href="#local-6989586621679723819"><span class="hs-identifier hs-type">indefiniteUnitId</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentId.html#ComponentId"><span class="hs-identifier hs-type">ComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span>
</span><span id="line-330"></span><span>    </span><span id="local-6989586621679723819"><span class="annot"><span class="annottext">indefiniteUnitId :: ComponentId -&gt; InstM UnitId
</span><a href="#local-6989586621679723819"><span class="hs-identifier hs-var hs-var">indefiniteUnitId</span></a></span></span><span> </span><span id="local-6989586621679723818"><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723818"><span class="hs-identifier hs-var">cid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-331"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679723817"><span class="annot"><span class="annottext">uid :: UnitId
</span><a href="#local-6989586621679723817"><span class="hs-identifier hs-var hs-var">uid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ComponentId -&gt; UnitId
</span><a href="Distribution.Types.UnitId.html#newSimpleUnitId"><span class="hs-identifier hs-var">newSimpleUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723818"><span class="hs-identifier hs-var">cid</span></a></span><span>
</span><span id="line-332"></span><span>        </span><span id="local-6989586621679723816"><span class="annot"><span class="annottext">Maybe ReadyComponent
</span><a href="#local-6989586621679723816"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; ComponentId -&gt; InstM (Maybe ReadyComponent)
</span><a href="#local-6989586621679723815"><span class="hs-identifier hs-var">indefiniteComponent</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723817"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723818"><span class="hs-identifier hs-var">cid</span></a></span><span>
</span><span id="line-333"></span><span>        </span><span class="annot"><span class="annottext">(InstS -&gt; (UnitId, InstS)) -&gt; InstM UnitId
forall a. (InstS -&gt; (a, InstS)) -&gt; InstM a
</span><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-var">InstM</span></a></span><span> </span><span class="annot"><span class="annottext">((InstS -&gt; (UnitId, InstS)) -&gt; InstM UnitId)
-&gt; (InstS -&gt; (UnitId, InstS)) -&gt; InstM UnitId
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723814"><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723814"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723817"><span class="hs-identifier hs-var">uid</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">UnitId -&gt; Maybe ReadyComponent -&gt; InstS -&gt; InstS
forall k a. Ord k =&gt; k -&gt; a -&gt; Map k a -&gt; Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#insert"><span class="hs-identifier hs-var">Map.insert</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723817"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ReadyComponent
</span><a href="#local-6989586621679723816"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
</span><a href="#local-6989586621679723814"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-334"></span><span>
</span><span id="line-335"></span><span>    </span><span class="annot"><a href="#local-6989586621679723815"><span class="hs-identifier hs-type">indefiniteComponent</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Types.UnitId.html#UnitId"><span class="hs-identifier hs-type">UnitId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Types.ComponentId.html#ComponentId"><span class="hs-identifier hs-type">ComponentId</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#InstM"><span class="hs-identifier hs-type">InstM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-336"></span><span>    </span><span id="local-6989586621679723815"><span class="annot"><span class="annottext">indefiniteComponent :: UnitId -&gt; ComponentId -&gt; InstM (Maybe ReadyComponent)
</span><a href="#local-6989586621679723815"><span class="hs-identifier hs-var hs-var">indefiniteComponent</span></a></span></span><span> </span><span id="local-6989586621679723813"><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723813"><span class="hs-identifier hs-var">uid</span></a></span></span><span> </span><span id="local-6989586621679723812"><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723812"><span class="hs-identifier hs-var">cid</span></a></span></span><span>
</span><span id="line-337"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679723811"><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ComponentId
-&gt; Map ComponentId LinkedComponent -&gt; Maybe LinkedComponent
forall k a. Ord k =&gt; k -&gt; Map k a -&gt; Maybe a
</span><a href="../../containers/src/Data.Map.Internal.html#lookup"><span class="hs-identifier hs-var">Map.lookup</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentId
</span><a href="#local-6989586621679723812"><span class="hs-identifier hs-var">cid</span></a></span><span> </span><span class="annot"><span class="annottext">Map ComponentId LinkedComponent
</span><a href="#local-6989586621679723898"><span class="hs-identifier hs-var">cmap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-338"></span><span>            </span><span class="hs-comment">-- We're going to process includes, in case some of them</span><span>
</span><span id="line-339"></span><span>            </span><span class="hs-comment">-- are fully definite even without any substitution.  We</span><span>
</span><span id="line-340"></span><span>            </span><span class="hs-comment">-- want to build those too; see #5634.</span><span>
</span><span id="line-341"></span><span>            </span><span id="local-6989586621679723810"><span class="annot"><span class="annottext">[ComponentInclude OpenUnitId ModuleRenaming]
</span><a href="#local-6989586621679723810"><span class="hs-identifier hs-var">inst_includes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ComponentInclude OpenUnitId ModuleRenaming]
-&gt; (ComponentInclude OpenUnitId ModuleRenaming
    -&gt; InstM (ComponentInclude OpenUnitId ModuleRenaming))
-&gt; InstM [ComponentInclude OpenUnitId ModuleRenaming]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#forM"><span class="hs-identifier hs-var">forM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; [ComponentInclude OpenUnitId ModuleRenaming]
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_includes"><span class="hs-identifier hs-var hs-var">lc_includes</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((ComponentInclude OpenUnitId ModuleRenaming
  -&gt; InstM (ComponentInclude OpenUnitId ModuleRenaming))
 -&gt; InstM [ComponentInclude OpenUnitId ModuleRenaming])
-&gt; (ComponentInclude OpenUnitId ModuleRenaming
    -&gt; InstM (ComponentInclude OpenUnitId ModuleRenaming))
-&gt; InstM [ComponentInclude OpenUnitId ModuleRenaming]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723809"><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723809"><span class="hs-identifier hs-var">ci</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-342"></span><span>                </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Set ModuleName -&gt; Bool
forall a. Set a -&gt; Bool
</span><a href="../../containers/src/Data.Set.Internal.html#null"><span class="hs-identifier hs-var">Set.null</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OpenUnitId -&gt; Set ModuleName
</span><a href="Distribution.Backpack.html#openUnitIdFreeHoles"><span class="hs-identifier hs-var">openUnitIdFreeHoles</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming -&gt; OpenUnitId
forall id rn. ComponentInclude id rn -&gt; id
</span><a href="Distribution.Types.ComponentInclude.html#ci_id"><span class="hs-identifier hs-var">ci_id</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723809"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-343"></span><span>                    </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621679723806"><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723806"><span class="hs-identifier hs-var">uid'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module -&gt; OpenUnitId -&gt; InstM DefUnitId
</span><a href="#local-6989586621679723868"><span class="hs-identifier hs-var">substUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming -&gt; OpenUnitId
forall id rn. ComponentInclude id rn -&gt; id
</span><a href="Distribution.Types.ComponentInclude.html#ci_id"><span class="hs-identifier hs-var">ci_id</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723809"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-344"></span><span>                            </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
-&gt; InstM (ComponentInclude OpenUnitId ModuleRenaming)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(ComponentInclude OpenUnitId ModuleRenaming
 -&gt; InstM (ComponentInclude OpenUnitId ModuleRenaming))
-&gt; ComponentInclude OpenUnitId ModuleRenaming
-&gt; InstM (ComponentInclude OpenUnitId ModuleRenaming)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723809"><span class="hs-identifier hs-var">ci</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ci_ann_id :: AnnotatedId OpenUnitId
</span><a href="Distribution.Types.ComponentInclude.html#ci_ann_id"><span class="hs-identifier hs-var">ci_ann_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(OpenUnitId -&gt; OpenUnitId)
-&gt; AnnotatedId OpenUnitId -&gt; AnnotatedId OpenUnitId
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OpenUnitId -&gt; OpenUnitId -&gt; OpenUnitId
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DefUnitId -&gt; OpenUnitId
</span><a href="Distribution.Backpack.html#DefiniteUnitId"><span class="hs-identifier hs-var">DefiniteUnitId</span></a></span><span> </span><span class="annot"><span class="annottext">DefUnitId
</span><a href="#local-6989586621679723806"><span class="hs-identifier hs-var">uid'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
-&gt; AnnotatedId OpenUnitId
forall id rn. ComponentInclude id rn -&gt; AnnotatedId id
</span><a href="Distribution.Types.ComponentInclude.html#ci_ann_id"><span class="hs-identifier hs-var hs-var">ci_ann_id</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723809"><span class="hs-identifier hs-var">ci</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-345"></span><span>                    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
-&gt; InstM (ComponentInclude OpenUnitId ModuleRenaming)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ComponentInclude OpenUnitId ModuleRenaming
</span><a href="#local-6989586621679723809"><span class="hs-identifier hs-var">ci</span></a></span><span>
</span><span id="line-346"></span><span>            </span><span id="local-6989586621679723804"><span class="annot"><span class="annottext">[AnnotatedId UnitId]
</span><a href="#local-6989586621679723804"><span class="hs-identifier hs-var">exe_deps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(AnnotatedId OpenUnitId -&gt; InstM (AnnotatedId UnitId))
-&gt; [AnnotatedId OpenUnitId] -&gt; InstM [AnnotatedId UnitId]
forall (t :: * -&gt; *) (f :: * -&gt; *) a b.
(Traversable t, Applicative f) =&gt;
(a -&gt; f b) -&gt; t a -&gt; f (t b)
</span><a href="../../base/src/Data.Traversable.html#traverse"><span class="hs-identifier hs-var">traverse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map ModuleName Module
-&gt; AnnotatedId OpenUnitId -&gt; InstM (AnnotatedId UnitId)
</span><a href="#local-6989586621679723864"><span class="hs-identifier hs-var">substExeDep</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; [AnnotatedId OpenUnitId]
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_exe_deps"><span class="hs-identifier hs-var hs-var">lc_exe_deps</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span>            </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679723803"><span class="annot"><span class="annottext">indefc :: IndefiniteComponent
</span><a href="#local-6989586621679723803"><span class="hs-identifier hs-var hs-var">indefc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IndefiniteComponent :: [ModuleName]
-&gt; Map ModuleName OpenModule
-&gt; [ComponentInclude OpenUnitId ModuleRenaming]
-&gt; IndefiniteComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#IndefiniteComponent"><span class="hs-identifier hs-type">IndefiniteComponent</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-348"></span><span>                        </span><span class="annot"><span class="annottext">indefc_requires :: [ModuleName]
</span><a href="Distribution.Backpack.ReadyComponent.html#indefc_requires"><span class="hs-identifier hs-var">indefc_requires</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((ModuleName, OpenModule) -&gt; ModuleName)
-&gt; [(ModuleName, OpenModule)] -&gt; [ModuleName]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(ModuleName, OpenModule) -&gt; ModuleName
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; [(ModuleName, OpenModule)]
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_insts"><span class="hs-identifier hs-var">lc_insts</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-349"></span><span>                        </span><span class="annot"><span class="annottext">indefc_provides :: Map ModuleName OpenModule
</span><a href="Distribution.Backpack.ReadyComponent.html#indefc_provides"><span class="hs-identifier hs-var">indefc_provides</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModuleShape -&gt; Map ModuleName OpenModule
</span><a href="Distribution.Backpack.ModuleShape.html#modShapeProvides"><span class="hs-identifier hs-var hs-var">modShapeProvides</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; ModuleShape
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_shape"><span class="hs-identifier hs-var hs-var">lc_shape</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-350"></span><span>                        </span><span class="annot"><span class="annottext">indefc_includes :: [ComponentInclude OpenUnitId ModuleRenaming]
</span><a href="Distribution.Backpack.ReadyComponent.html#indefc_includes"><span class="hs-identifier hs-var">indefc_includes</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[ComponentInclude OpenUnitId ModuleRenaming]
</span><a href="#local-6989586621679723810"><span class="hs-identifier hs-var">inst_includes</span></a></span><span> </span><span class="annot"><span class="annottext">[ComponentInclude OpenUnitId ModuleRenaming]
-&gt; [ComponentInclude OpenUnitId ModuleRenaming]
-&gt; [ComponentInclude OpenUnitId ModuleRenaming]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent -&gt; [ComponentInclude OpenUnitId ModuleRenaming]
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_sig_includes"><span class="hs-identifier hs-var hs-var">lc_sig_includes</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span>
</span><span id="line-351"></span><span>                    </span><span class="hs-special">}</span><span>
</span><span id="line-352"></span><span>            </span><span class="annot"><span class="annottext">Maybe ReadyComponent -&gt; InstM (Maybe ReadyComponent)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe ReadyComponent -&gt; InstM (Maybe ReadyComponent))
-&gt; Maybe ReadyComponent -&gt; InstM (Maybe ReadyComponent)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent -&gt; Maybe ReadyComponent
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">ReadyComponent :: AnnotatedId UnitId
-&gt; OpenUnitId
-&gt; ComponentId
-&gt; Component
-&gt; [AnnotatedId UnitId]
-&gt; Bool
-&gt; Either IndefiniteComponent InstantiatedComponent
-&gt; ReadyComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#ReadyComponent"><span class="hs-identifier hs-type">ReadyComponent</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-353"></span><span>                    </span><span class="annot"><span class="annottext">rc_ann_id :: AnnotatedId UnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_ann_id"><span class="hs-identifier hs-var">rc_ann_id</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; AnnotatedId ComponentId
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_ann_id"><span class="hs-identifier hs-var hs-var">lc_ann_id</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">ann_id :: UnitId
</span><a href="Distribution.Types.AnnotatedId.html#ann_id"><span class="hs-identifier hs-var">ann_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="#local-6989586621679723813"><span class="hs-identifier hs-var">uid</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span>
</span><span id="line-354"></span><span>                    </span><span class="annot"><span class="annottext">rc_cid :: ComponentId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_cid"><span class="hs-identifier hs-var">rc_cid</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LinkedComponent -&gt; ComponentId
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_cid"><span class="hs-identifier hs-var">lc_cid</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-355"></span><span>                    </span><span class="annot"><span class="annottext">rc_open_uid :: OpenUnitId
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_open_uid"><span class="hs-identifier hs-var">rc_open_uid</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LinkedComponent -&gt; OpenUnitId
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_uid"><span class="hs-identifier hs-var">lc_uid</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-356"></span><span>                    </span><span class="annot"><span class="annottext">rc_component :: Component
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_component"><span class="hs-identifier hs-var">rc_component</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LinkedComponent -&gt; Component
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_component"><span class="hs-identifier hs-var hs-var">lc_component</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-357"></span><span>                    </span><span class="hs-comment">-- It's always fully built</span><span>
</span><span id="line-358"></span><span>                    </span><span class="annot"><span class="annottext">rc_exe_deps :: [AnnotatedId UnitId]
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_exe_deps"><span class="hs-identifier hs-var">rc_exe_deps</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[AnnotatedId UnitId]
</span><a href="#local-6989586621679723804"><span class="hs-identifier hs-var">exe_deps</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-359"></span><span>                    </span><span class="annot"><span class="annottext">rc_public :: Bool
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_public"><span class="hs-identifier hs-var">rc_public</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LinkedComponent -&gt; Bool
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_public"><span class="hs-identifier hs-var hs-var">lc_public</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723811"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-360"></span><span>                    </span><span class="annot"><span class="annottext">rc_i :: Either IndefiniteComponent InstantiatedComponent
</span><a href="Distribution.Backpack.ReadyComponent.html#rc_i"><span class="hs-identifier hs-var">rc_i</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IndefiniteComponent
-&gt; Either IndefiniteComponent InstantiatedComponent
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">IndefiniteComponent
</span><a href="#local-6989586621679723803"><span class="hs-identifier hs-var">indefc</span></a></span><span>
</span><span id="line-361"></span><span>                </span><span class="hs-special">}</span><span>
</span><span id="line-362"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ReadyComponent -&gt; InstM (Maybe ReadyComponent)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe ReadyComponent
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-363"></span><span>
</span><span id="line-364"></span><span>    </span><span id="local-6989586621679723899"><span class="annot"><span class="annottext">ready_map :: InstS
</span><a href="#local-6989586621679723899"><span class="hs-identifier hs-var hs-var">ready_map</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((), InstS) -&gt; InstS
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">(((), InstS) -&gt; InstS) -&gt; ((), InstS) -&gt; InstS
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InstM () -&gt; InstS -&gt; ((), InstS)
forall a. InstM a -&gt; InstS -&gt; (a, InstS)
</span><a href="Distribution.Backpack.ReadyComponent.html#runInstM"><span class="hs-identifier hs-var hs-var">runInstM</span></a></span><span> </span><span class="annot"><span class="annottext">InstM ()
</span><a href="#local-6989586621679723799"><span class="hs-identifier hs-var">work</span></a></span><span> </span><span class="annot"><span class="annottext">InstS
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span>
</span><span id="line-365"></span><span>
</span><span id="line-366"></span><span>    </span><span id="local-6989586621679723799"><span class="annot"><span class="annottext">work :: InstM ()
</span><a href="#local-6989586621679723799"><span class="hs-identifier hs-var hs-var">work</span></a></span></span><span>
</span><span id="line-367"></span><span>        </span><span class="hs-comment">-- Top-level instantiation per subst0</span><span>
</span><span id="line-368"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map ModuleName Module -&gt; Bool
forall k a. Map k a -&gt; Bool
</span><a href="../../containers/src/Data.Map.Internal.html#null"><span class="hs-identifier hs-var">Map.null</span></a></span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723903"><span class="hs-identifier hs-var">subst0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-369"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span id="local-6989586621679723796"><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723796"><span class="hs-identifier hs-var">lc</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LinkedComponent -&gt; Bool) -&gt; [LinkedComponent] -&gt; [LinkedComponent]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#filter"><span class="hs-identifier hs-var">filter</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent -&gt; Bool
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_public"><span class="hs-identifier hs-var hs-var">lc_public</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map ComponentId LinkedComponent -&gt; [LinkedComponent]
forall k a. Map k a -&gt; [a]
</span><a href="../../containers/src/Data.Map.Internal.html#elems"><span class="hs-identifier hs-var">Map.elems</span></a></span><span> </span><span class="annot"><span class="annottext">Map ComponentId LinkedComponent
</span><a href="#local-6989586621679723898"><span class="hs-identifier hs-var">cmap</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-370"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">DefUnitId
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ComponentId -&gt; Map ModuleName Module -&gt; InstM DefUnitId
</span><a href="#local-6989586621679723894"><span class="hs-identifier hs-var">instantiateUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; ComponentId
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_cid"><span class="hs-identifier hs-var">lc_cid</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723796"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
</span><a href="#local-6989586621679723903"><span class="hs-identifier hs-var">subst0</span></a></span><span>
</span><span id="line-371"></span><span>             </span><span class="annot"><span class="annottext">() -&gt; InstM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-372"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-373"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LinkedComponent] -&gt; (LinkedComponent -&gt; InstM ()) -&gt; InstM ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
t a -&gt; (a -&gt; m b) -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#forM_"><span class="hs-identifier hs-var">forM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Map ComponentId LinkedComponent -&gt; [LinkedComponent]
forall k a. Map k a -&gt; [a]
</span><a href="../../containers/src/Data.Map.Internal.html#elems"><span class="hs-identifier hs-var">Map.elems</span></a></span><span> </span><span class="annot"><span class="annottext">Map ComponentId LinkedComponent
</span><a href="#local-6989586621679723898"><span class="hs-identifier hs-var">cmap</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((LinkedComponent -&gt; InstM ()) -&gt; InstM ())
-&gt; (LinkedComponent -&gt; InstM ()) -&gt; InstM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679723794"><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723794"><span class="hs-identifier hs-var">lc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-374"></span><span>            </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">[(ModuleName, OpenModule)] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; [(ModuleName, OpenModule)]
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_insts"><span class="hs-identifier hs-var">lc_insts</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723794"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-375"></span><span>                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">ComponentId -&gt; Map ModuleName Module -&gt; InstM DefUnitId
</span><a href="#local-6989586621679723894"><span class="hs-identifier hs-var">instantiateUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; ComponentId
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_cid"><span class="hs-identifier hs-var">lc_cid</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723794"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Map ModuleName Module
forall k a. Map k a
</span><a href="../../containers/src/Data.Map.Internal.html#empty"><span class="hs-identifier hs-var">Map.empty</span></a></span><span> </span><span class="annot"><span class="annottext">InstM DefUnitId -&gt; InstM () -&gt; InstM ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; InstM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">ComponentId -&gt; InstM UnitId
</span><a href="#local-6989586621679723819"><span class="hs-identifier hs-var">indefiniteUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LinkedComponent -&gt; ComponentId
</span><a href="Distribution.Backpack.LinkedComponent.html#lc_cid"><span class="hs-identifier hs-var">lc_cid</span></a></span><span> </span><span class="annot"><span class="annottext">LinkedComponent
</span><a href="#local-6989586621679723794"><span class="hs-identifier hs-var">lc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InstM UnitId -&gt; InstM () -&gt; InstM ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; InstM ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-377"></span></pre></body></html>